# 构建阶段
FROM node:22.17.1-alpine as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm config set registry https://registry.npmmirror.com
RUN npm install
COPY . .
RUN npm run build   # 不加任何 --mode

# 运行阶段
FROM registry.cn-hangzhou.aliyuncs.com/jsonhc/nginx:1.15
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
